#ifndef OTA_COMMON_H
#define OTA_COMMON_H

#include <stdint.h>

#define SPL_REGION_START_ADDR   (0x00000000)
#define SPL_REGION_SIZE         (0x00000000)
#define FIB_REGION_START_ADDR   (0x00000000)
#define FIB_REGION_SIZE         (0x00000000)
#define APP_REGION_START_ADDR   (0x00000000)
#define APP_REGION_SIZE         (0x00000000)
#define UPG_REGION_START_ADDR   (0x00000000)
#define UPG_REGION_SIZE         (0x00000000)

#define CAMELLIA_SPL_VERSION_MAJOR  1
#define CAMELLIA_SPL_VERSION_MINOR  0
#define CAMELLIA_SPL_VERSION_REV    0

#define UPG_FLAG_UPG    (0x0001)

#ifdef __cplusplus
extern "C" {
#endif

typedef enum RET{
    RET_OK = 0,
    RET_ERROR,
    RET_CRC16_CHECK_FAILED,
} RET_t;

typedef struct FirmwareInformationBlock {
    uint8_t magic_number[4];
    uint16_t upgrade_flag;
    uint16_t firmware_crc16;
    uint32_t firmware_size;
    uint16_t upgrade_firmware_crc16;
    
}FirmwareInformationBlock_t;

typedef FirmwareInformationBlock_t FIB_t;

#ifdef __cplusplus
}
#endif

#endif
